#define _INC_STDLIB
#include <windows.h>

__declspec(noinline)
PVOID __cdecl malloc(size_t Size)
{
	return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Size);
}

__declspec(noinline)
void __cdecl free(PVOID ptr)
{
	if(ptr)
		HeapFree(GetProcessHeap(), 0, ptr);
}

__declspec(noinline)
LPVOID __cdecl realloc(LPVOID ptr, size_t Size)
{
	return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ptr, Size);
}

__declspec (naked)
int __cdecl _purecall()
{
	_asm int 3
}

LPVOID __cdecl operator new (size_t size)
{
	return malloc(size);
}

LPVOID __cdecl operator new [] (size_t size)
{
	return malloc(size);
}

VOID __cdecl operator delete (LPVOID ptr)
{
	free(ptr);
}

VOID __cdecl operator delete [] (LPVOID ptr)
{
	free(ptr);
}

